package user.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import user.form.RegForm;

import mvc.action.BaseAction;
import mvc.form.BaseForm;

public class RegAction implements BaseAction {

	@Override
	public String execute(HttpServletRequest request, BaseForm form, Map<String, String> actionForward) {
		RegForm regForm = (RegForm) form;
		String url = "error";
		if (regForm.getUserpwd1().equals(regForm.getUserpwd2())) {
			request.setAttribute("success", "注册成功！");
			url = "success";
		} else {
			request.setAttribute("error", "注册失败！两次密码不一致！");
		}
		return actionForward.get(url);
	}

}
